<div id="datagrid_${action_id}_tb" style="padding:5px;height:auto">
	<div>		
		名称: 
		<input class="easyui-validatebox" style="width: 200px;" name="_searcher_lky_name" >
		地址: 
		<input class="easyui-validatebox" style="width: 200px;" name="_searcher_lky_address" >
		联系人: 
		<input class="easyui-validatebox" style="width: 200px;" name="_searcher_lky_linkMan" >
		
		<a href="javascript:$('#datagrid_${action_id}_tb').searcher('doSearch');" class="easyui-linkbutton" data-options="iconCls:'icon-search'" >查询</a>
	</div>
</div>
<table id="datagrid_${action_id}" ></table>
<script type="text/javascript">

$(function(){
	$('#datagrid_${action_id}_tb').searcher({
		doSearch:function(qp){
			$('#datagrid_${action_id}').datagrid('options').queryParams = qp;
			$('#datagrid_${action_id}').datagrid('reload');
		}
	});

	
	$('#datagrid_${action_id}').datagrid({
		iconCls:'icon-save',
		width:'auto',
		height:'auto',
		nowrap: false,
		fit:true,
		fitColumns:true,
		striped: true,
		url:'${request.contextPath}${namespace?default('')}/agency/agency-datagrid.json',
		sortName: 'gmtCreate',
		sortOrder: 'desc',
		remoteSort: true,
		singleSelect : ${cb?string('false','true')},
		idField:'id',
		onBeforeLoad:function(){$('#datagrid_${action_id}').datagrid('unselectAll');},
		columns:[[
		          	<#if cb>
					{field:'ck',checkbox:true},
		          	</#if>
					{field:'name',title:'${action.getDatagridTitle('name')}',width:80,align:'center',sortable:true},
					{field:'address',title:'${action.getDatagridTitle('address')}',width:150,align:'center'},
					{field:'linkMan',title:'${action.getDatagridTitle('linkMan')}',width:80,align:'center'},
					{field:'mobile',title:'${action.getDatagridTitle('mobile')}',width:80,align:'center'},
					{field:'gmtCreate',title:'${action.getDatagridTitle('gmtCreate')}',width:80,align:'center',sortable:true},
					{field:'state',title:'${action.getDatagridTitle('state')}',width:50,align:'center',formatter:function(val, rec){
						<#list states as state >
							if(val== ${state.state}){
								return '${action.getDatagridTitle('state.'+state.name())}'
							}
						</#list>
					}}
				]],
		pagination:true,
		rownumbers:true,
		onDblClickRow:function(idx,data){if(typeof onDblClickRow_${action_id} != 'undefined'){onDblClickRow_${action_id}(idx,data)}},
		onClickRow:function(idx,data){if(typeof onClickRow_${action_id} != 'undefined'){onClickRow_${action_id}(idx,data)}},
		onRowContextMenu:function(e,idx,data){if(typeof onRowContextMenu_${action_id} != 'undefined'){$(this).datagrid('selectRow', idx);onRowContextMenu_${action_id}(e,idx,data)}},
		toolbar:'#datagrid_${action_id}_tb'
	});

});

</script>	